﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Kokomo
{
	/// <summary>
	/// Provides extension methods for <see cref="double"/>.
	/// </summary>
	public static class DoubleExtensions
	{
		/// <summary>
		/// Aligns the specified number to the nearest interval boundary.
		/// </summary>
		/// <param name="x">The x.</param>
		/// <param name="interval">The interval.</param>
		/// <returns></returns>
		public static double Align(this double x, double interval)
		{
			return x - (x % interval);
		}
	}
}
